package com.dlc.shop.systemtest.util;

import com.dlc.shop.systemtest.constants.Constant;

/**
 * url枚举
 * @author yxf
 * @date 2020/11/20
 */
public enum UrlEnum {

    /**
     * 用户端
     */
    API(1, Constant.API_TOKEN),

    /**
     * 门店端
     */
    STATION(2, Constant.STATION_TOKEN),

    /**
     * 商家端
     */
    SHOP(3, Constant.SHOP_TOKEN),

    /**
     * 平台端
     */
    PLATFORM(4, Constant.PLATFORM_TOKEN)
    ;

    private final Integer value;

    private final String token;

    public Integer value() {
        return value;
    }

    public String token() {
        return token;
    }

    UrlEnum(Integer value, String token) {
        this.value = value;
        this.token = token;
    }

    public static UrlEnum instance(Integer value) {
        UrlEnum[] enums = values();
        for (UrlEnum statusEnum : enums) {
            if (statusEnum.value().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }

}
